package com.ruoyi.business.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.business.mapper.TMergeOrderDetailMapper;
import com.ruoyi.business.domain.TMergeOrderDetail;
import com.ruoyi.business.service.ITMergeOrderDetailService;
import com.ruoyi.common.core.text.Convert;

/**
 * 合并订单明细Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-04-04
 */
@Service
public class TMergeOrderDetailServiceImpl implements ITMergeOrderDetailService 
{
    @Autowired
    private TMergeOrderDetailMapper tMergeOrderDetailMapper;

    /**
     * 查询合并订单明细
     * 
     * @param id 合并订单明细主键
     * @return 合并订单明细
     */
    @Override
    public TMergeOrderDetail selectTMergeOrderDetailById(Long id)
    {
        return tMergeOrderDetailMapper.selectTMergeOrderDetailById(id);
    }

    /**
     * 查询合并订单明细列表
     * 
     * @param tMergeOrderDetail 合并订单明细
     * @return 合并订单明细
     */
    @Override
    public List<TMergeOrderDetail> selectTMergeOrderDetailList(TMergeOrderDetail tMergeOrderDetail)
    {
        return tMergeOrderDetailMapper.selectTMergeOrderDetailList(tMergeOrderDetail);
    }

    /**
     * 新增合并订单明细
     * 
     * @param tMergeOrderDetail 合并订单明细
     * @return 结果
     */
    @Override
    public int insertTMergeOrderDetail(TMergeOrderDetail tMergeOrderDetail)
    {
        tMergeOrderDetail.setCreateTime(DateUtils.getNowDate());
        return tMergeOrderDetailMapper.insertTMergeOrderDetail(tMergeOrderDetail);
    }

    /**
     * 修改合并订单明细
     * 
     * @param tMergeOrderDetail 合并订单明细
     * @return 结果
     */
    @Override
    public int updateTMergeOrderDetail(TMergeOrderDetail tMergeOrderDetail)
    {
        tMergeOrderDetail.setUpdateTime(DateUtils.getNowDate());
        return tMergeOrderDetailMapper.updateTMergeOrderDetail(tMergeOrderDetail);
    }

    /**
     * 批量删除合并订单明细
     * 
     * @param ids 需要删除的合并订单明细主键
     * @return 结果
     */
    @Override
    public int deleteTMergeOrderDetailByIds(String ids)
    {
        return tMergeOrderDetailMapper.deleteTMergeOrderDetailByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除合并订单明细信息
     * 
     * @param id 合并订单明细主键
     * @return 结果
     */
    @Override
    public int deleteTMergeOrderDetailById(Long id)
    {
        return tMergeOrderDetailMapper.deleteTMergeOrderDetailById(id);
    }
}
